package io.fft.flight.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: likailun
 * @Description: 就旅行订单状态
 * @Date: create in 2024/7/9 21:51
 */
@Getter
@AllArgsConstructor
public enum JiulvxingOrderStatusEnum implements BaseEnum<String> {

    CONFIRM("1", "待确认"),
    CONFIRM_OK("3", "订单确认成功"),
    BOOK_OK("2", "订座成功等待支付"),
    PAY_OK("4", "支付成功等待出票"),
    TICKET_OK("5", "出票完成"),
    CANCEL_OK("7", "订单取消"),
    REFUNDEDNEW("12", "退款完成"),
    REFUND_NO_TICKET("13", "未出票申请退款");

    private final String code;
    private final String message;

    public static Optional<JiulvxingOrderStatusEnum> getByCode(String code) {
        return Arrays.stream(JiulvxingOrderStatusEnum.values()).filter(item -> item.getCode().equals(code)).findAny();
    }
}
